package com.wdg.fegin;

import com.wdg.pojo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("provider-index")
public interface IndexFegin {
    //今日推荐，根据推荐表查出
    @GetMapping("provider_index/getCookBookForIndex")
    List<TodayRecommend> getCookBookForIndex();

    //轮播图，根据轮播表查出
    @GetMapping("provider_index/getCircleImageForIndex")
    List<CircleImage> getCircleImageForIndex();

    //最新菜谱,根据上传时间查出
    @GetMapping("provider_index/getNewCookBookForIndex")
    List<Cookbook> getNewCookBookForIndex();

    //热门分类,随机查询分类展示
    @GetMapping("provider_index/getHotFoodForIndex")
    List<Food> getHotFoodForIndex();

    @GetMapping("provider_index/getCookBookByCbid/{cbid}")
    Cookbook getCookBookByCbid(@PathVariable("cbid") String cbid);

   //增加菜谱浏览量
    @GetMapping("provider_index/addCookBookView/{cbid}")
    void addCookBookView(@PathVariable("cbid") String cbid);
    //查询分类

    @GetMapping("provider_index/getAllSort")
    List<Foodtitle> getAllSort();

    @GetMapping("provider_index/getCookBookByFid/{fid}")
    List<Sort> getCookBookByFid(@RequestParam("fid") int fid, @RequestParam("pageId") int pageId);
}
